﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModuleLevel.aspx.cs" Inherits="Jy123.Web.Manage.AddModuleLevel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>管理组件</title>
    <link href="css/custom/jquery.ui.css" rel="stylesheet" type="text/css" />
    <link href="css/main.css" rel="stylesheet" type="text/css" />

    <script src="js/jquery.js" type="text/javascript"></script>

    <script src="js/jquery.ui.js" type="text/javascript"></script>

    <script src="js/main.js" type="text/javascript"></script>

    <script type="text/javascript" language="javascript">
	$(function() {
		$("#slider").slider({range: "min",value:5000,min: 5000,max: 500000,step: 5000,
			slide: function(event, ui) {
				$("#moneyTextBox").val( ui.value);
			}
		});
		$("#moneyTextBox").val($("#slider").slider("value"));
	});
	
	function Validate(){         
        var fileUploadBig=document.getElementById('<%=fileUploadBig.ClientID %>');
        var actionHidden=document.getElementById('<%=actionTypeHidden.ClientID %>');
        var button=document.getElementById('<%=SaveButton.ClientID %>');
        button.disabled=""; 
        var fileName;
        var index;
        var length;
        var fileType;
        if(fileUploadBig.value==''){        
            if(actionHidden.value=='Add'){
                $("#noBigLogoSpan").css('display','block');
                $("#errorBigLogoSpan").css('display','none');
                button.disabled="disabled";                
            }
        }else{
            $("#noBigLogoSpan").css('display','none');
            fileName=fileUploadBig.value;
            index=fileName.lastIndexOf(".")+1;
            length=fileName.length-fileName.lastIndexOf(".")-1;                                                  
            fileType=fileName.substr(index,length);           
           if(fileType=='jpg'||fileType=='gif'||fileType=='tiff'||fileType=='jpeg'||fileType=='png'||fileType=='bmp'){
                $("#errorBigLogoSpan").css('display','none');
                $("#JTypeImage").attr("src",fileUploadBig.value)            
           }else{
                $("#errorBigLogoSpan").css('display','block');
                button.disabled="disabled";                 
           }          
        }
      }
    </script>

</head>
<body>
    <h4>
        <a href="#"><span>组件等级管理</span></a></h4>
    <form id="addModuleLevelForm" runat="server">
    <div class="register">
        <ul>
            <li class="w110r">组件大类型 </li>
            <li>
                <asp:DropDownList ID="bigTypeDropDown" runat="server" AutoPostBack="true" OnSelectedIndexChanged="bigTypeDropDown_Change">
                </asp:DropDownList>
            </li>
            <li>
                <asp:RequiredFieldValidator ID="BigTypeRequired" CssClass="warning" runat="server"
                    ControlToValidate="BigTypeDropDown" ErrorMessage="请选择大类型" Display="Dynamic" ForeColor=""
                    InitialValue="-1"></asp:RequiredFieldValidator>
            </li>
        </ul>
        <ul>
            <li class="w110r">组件类型 </li>
            <li>
                <asp:DropDownList ID="typeDropDown" runat="server">
                </asp:DropDownList>
            </li>
            <li>
                <asp:RequiredFieldValidator ID="typeRequired" CssClass="warning" runat="server" ControlToValidate="typeDropDown"
                    ErrorMessage="请选择组件类型" Display="Dynamic" ForeColor="" InitialValue="-1"></asp:RequiredFieldValidator>
            </li>
        </ul>
        <ul>
            <li class="w110r">等级名称 </li>
            <li>
                <asp:TextBox ID="levelNameTextBox" runat="server" MaxLength="20" CssClass="text"></asp:TextBox>
            </li>
            <li>
                <asp:RequiredFieldValidator ID="levelNameRequired" CssClass="warning" runat="server"
                    ControlToValidate="levelNameTextBox" ErrorMessage="请填写等级名称" Display="Dynamic"
                    ForeColor=""></asp:RequiredFieldValidator>
            </li>
        </ul>
        <div id="ClubDiv" runat="server" visible="false">
            <ul>
                <li class="w110r">体力 </li>
                <li>
                    <asp:TextBox ID="fitnessTextBox" runat="server" MaxLength="20" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="fitnessRequired" CssClass="warning" runat="server"
                        ControlToValidate="fitnessTextBox" ErrorMessage="请填写体力值" Display="Dynamic" ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="fitnessRange" runat="server" CssClass="warning" ErrorMessage="请填写1－255之间的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="fitnessTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="255"></asp:RangeValidator>
                </li>
            </ul>
            <ul>
                <li class="w110r">体力峰值 </li>
                <li>
                    <asp:TextBox ID="peakPHTextBox" runat="server" MaxLength="20" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" CssClass="warning" runat="server"
                        ControlToValidate="peakPHTextBox" ErrorMessage="请填写体力峰值" Display="Dynamic" ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="RangeValidator1" runat="server" CssClass="warning" ErrorMessage="请填写1－255之间的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="peakPHTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="255"></asp:RangeValidator>
                </li>
            </ul>
            <ul>
                <li class="w110r">活力 </li>
                <li>
                    <asp:TextBox ID="livenessTextBox" runat="server" MaxLength="20" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" CssClass="warning" runat="server"
                        ControlToValidate="livenessTextBox" ErrorMessage="请填写体力值" Display="Dynamic" ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="RangeValidator4" runat="server" CssClass="warning" ErrorMessage="请填写1－255之间的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="livenessTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="255"></asp:RangeValidator>
                </li>
            </ul>
            <ul>
                <li class="w110r">活力峰值 </li>
                <li>
                    <asp:TextBox ID="peakLiveTextBox" runat="server" MaxLength="20" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" CssClass="warning" runat="server"
                        ControlToValidate="peakLiveTextBox" ErrorMessage="请填写活力峰值" Display="Dynamic"
                        ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="RangeValidator5" runat="server" CssClass="warning" ErrorMessage="请填写1－255之间的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="peakLiveTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="255"></asp:RangeValidator>
                </li>
            </ul>
            <ul>
                <li class="w110r">士气 </li>
                <li>
                    <asp:TextBox ID="moralTextBox" runat="server" MaxLength="20" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="moralRequired" CssClass="warning" runat="server"
                        ControlToValidate="moralTextBox" ErrorMessage="请填写士气值" Display="Dynamic" ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="moralRange" runat="server" CssClass="warning" ErrorMessage="请填写1－255之间的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="moralTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="255"></asp:RangeValidator>
                </li>
            </ul>
            <ul>
                <li class="w110r">士气峰值 </li>
                <li>
                    <asp:TextBox ID="peakMoralTextBox" runat="server" MaxLength="20" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" CssClass="warning" runat="server"
                        ControlToValidate="peakMoralTextBox" ErrorMessage="请填写士气峰值" Display="Dynamic"
                        ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="RangeValidator2" runat="server" CssClass="warning" ErrorMessage="请填写1－255之间的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="peakMoralTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="255"></asp:RangeValidator>
                </li>
            </ul>
            <ul>
                <li class="w110r">技术 </li>
                <li>
                    <asp:TextBox ID="skillTextBox" runat="server" MaxLength="20" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="skillRequired" CssClass="warning" runat="server"
                        ControlToValidate="skillTextBox" ErrorMessage="请填写技术值" Display="Dynamic" ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="skillRange" runat="server" CssClass="warning" ErrorMessage="请填写1－255之间的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="skillTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="255"></asp:RangeValidator>
                </li>
            </ul>
            <ul>
                <li class="w110r">技术峰值 </li>
                <li>
                    <asp:TextBox ID="peakSkillTextBox" runat="server" MaxLength="20" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" CssClass="warning" runat="server"
                        ControlToValidate="peakSkillTextBox" ErrorMessage="请填写技术峰值" Display="Dynamic"
                        ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="RangeValidator3" runat="server" CssClass="warning" ErrorMessage="请填写1－255之间的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="peakSkillTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="255"></asp:RangeValidator>
                </li>
            </ul>
            <ul>
                <li class="w110r">经验 </li>
                <li>
                    <asp:TextBox ID="expTextBox" runat="server" MaxLength="20" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" CssClass="warning" runat="server"
                        ControlToValidate="expTextBox" ErrorMessage="请填写经验值" Display="Dynamic" ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="RangeValidator6" runat="server" CssClass="warning" ErrorMessage="请填写1－255之间的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="expTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="99999999"></asp:RangeValidator>
                </li>
            </ul>
            <ul>
                <li class="w110r">经验峰值 </li>
                <li>
                    <asp:TextBox ID="peakExpTextBox" runat="server" MaxLength="20" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" CssClass="warning" runat="server"
                        ControlToValidate="peakExpTextBox" ErrorMessage="请填写经验峰值" Display="Dynamic" ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="RangeValidator7" runat="server" CssClass="warning" ErrorMessage="请填写1－99999999之间的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="peakExpTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="99999999"></asp:RangeValidator>
                </li>
            </ul>
        </div>
        <div id="PublicDiv" runat="server" visible="false">
            <ul>
                <li class="w110r">比赛次数 </li>
                <li>
                    <asp:TextBox ID="timesTextBox" runat="server" MaxLength="6" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="timesRequired" CssClass="warning" runat="server"
                        ControlToValidate="timesTextBox" ErrorMessage="请填写技术值" Display="Dynamic" ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="timesRange" runat="server" CssClass="warning" ErrorMessage="请填写大于0的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="timesTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="999999"></asp:RangeValidator>
                </li>
            </ul>
        </div>
        <div id="TCenterDiv" runat="server" visible="false">
            <ul>
                <li class="w110r">训练中心容量 </li>
                <li>
                    <asp:TextBox ID="scopeTextBox" runat="server" MaxLength="6" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="scopeRequired" CssClass="warning" runat="server"
                        ControlToValidate="scopeTextBox" ErrorMessage="请填写训练中心容量值" Display="Dynamic"
                        ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="scopeRange" runat="server" CssClass="warning" ErrorMessage="请填写1-255之间的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="scopeTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="255"></asp:RangeValidator>
                </li>
            </ul>
        </div>
        <div id="venuesDiv" runat="server" visible="false">
         <ul>
                <li class="w110r">参赛费用 </li>
                <li>
                    <asp:TextBox ID="costTextBox" runat="server" MaxLength="6" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" CssClass="warning" runat="server"
                        ControlToValidate="costTextBox" ErrorMessage="请填写参赛费用" Display="Dynamic"
                        ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="RangeValidator8" runat="server" CssClass="warning" ErrorMessage="请填写1-99999999之间的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="costTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="99999999"></asp:RangeValidator>
                </li>
            </ul>
             <ul>
                <li class="w110r">赛场收入 </li>
                <li>
                    <asp:TextBox ID="incomeTextBox" runat="server" MaxLength="6" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" CssClass="warning" runat="server"
                        ControlToValidate="incomeTextBox" ErrorMessage="请填写赛场收入" Display="Dynamic"
                        ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="RangeValidator9" runat="server" CssClass="warning" ErrorMessage="请填写1-99999999之间的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="incomeTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="99999999"></asp:RangeValidator>
                </li>
            </ul>
             <ul>
                <li class="w110r">奖金 </li>
                <li>
                    <asp:TextBox ID="premiumTextBox" runat="server" MaxLength="6" CssClass="text"></asp:TextBox>
                </li>
                <li>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator10" CssClass="warning" runat="server"
                        ControlToValidate="premiumTextBox" ErrorMessage="请填写奖金" Display="Dynamic"
                        ForeColor=""></asp:RequiredFieldValidator>
                </li>
                <li>
                    <asp:RangeValidator ID="RangeValidator10" runat="server" CssClass="warning" ErrorMessage="请填写1-99999999之间的整数"
                        Display="Dynamic" ForeColor="" ControlToValidate="premiumTextBox" Type="Integer"
                        MinimumValue="1" MaximumValue="99999999"></asp:RangeValidator>
                </li>
            </ul>
        </div>
        <ul>
            <li class="w110r">升至该等级所需金钱 </li>
            <li>
                <asp:TextBox ID="moneyTextBox" runat="server" MaxLength="20" CssClass="text"></asp:TextBox>
            </li>
            <li class="sliderli">
                <div id="slider" class="slider">
                    <ul>
                    </ul>
                </div>
            </li>
        </ul>
        <ul>
            <li class="w110r">等级 </li>
            <li>
                <asp:DropDownList ID="levelDropDown" runat="server">
                </asp:DropDownList>
            </li>
            <li>
                <asp:RequiredFieldValidator ID="levelRequired" CssClass="warning" runat="server"
                    ControlToValidate="levelDropDown" ErrorMessage="请选择组件等级" Display="Dynamic" ForeColor=""
                    InitialValue="-1"></asp:RequiredFieldValidator>
            </li>
        </ul>        
        <ul>
        <li class="w110r">等级图片</li>
            <li>
                <asp:FileUpload ID="fileUploadBig" CssClass="text" runat="server" onchange="Validate()" />
            </li>
            <li>
                <img id="JTypeImage" runat="server" alt="" src="" class="carimg" />
            </li>
            <li><span id="noBigLogoSpan" class="warning" style="display: none">请上传一张图片</span> <span
                id="errorBigLogoSpan" class="warning" style="display: none">请选择正确的图片格式</span></li>
        </ul>
        <ul class="bb">
            <li class="w110r"></li>
            <li>
                <asp:HiddenField ID="actionTypeHidden" runat="server" Value="Add" />
                <asp:HiddenField ID="idHidden" runat="server" />
                <asp:Button ID="SaveButton" runat="server" CssClass="button" Text="保存" OnClick="Save" />
            </li>
        </ul>
    </div>
    <asp:Repeater ID="addLevelRepeater" runat="server" Visible="false" OnItemDataBound="Repeater_DataBound"
        OnItemCommand="Repeater_Command">
        <HeaderTemplate>
            <table class="tblist">
                <tr>
                    <th>
                        组件类型
                    </th>
                    <th>
                        等级名称
                    </th>
                    <th>
                        体力
                    </th>
                    <th>
                        体力峰值
                    </th>
                    <th>
                        活力
                    </th>
                    <th>
                        活力峰值
                    </th>
                    <th>
                        士气
                    </th>
                    <th>
                        士气峰值
                    </th>
                    <th>
                        技术
                    </th>
                    <th>
                        技术峰值
                    </th>
                    <th>
                        经验
                    </th>
                    <th>
                        经验峰值
                    </th>
                    <th>
                        容量
                    </th>
                    <th>
                        比赛次数
                    </th>
                    <th>
                        升级所需金钱
                    </th>
                    <th>
                        等级
                    </th>
                    <th>
                    </th>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td>
                    <asp:HiddenField ID="idHidden" runat="server" />
                    <asp:Label ID="typeNameLabel" runat="server"></asp:Label>
                </td>
                <td>
                    <%#Eval("LName")%>
                </td>
                <td>
                    <%#Eval("PhysicalFitness")%>
                </td>
                <td>
                    <%#Eval("PeakPH")%>
                </td>
                <td>
                    <%#Eval("Liveness")%>
                </td>
                <td>
                    <%#Eval("PeakLive")%>
                </td>
                <td>
                    <%#Eval("Moral")%>
                </td>
                <td>
                    <%#Eval("PeakMoral")%>
                </td>
                <td>
                    <%#Eval("Skill")%>
                </td>
                <td>
                    <%#Eval("PeakSkill")%>
                </td>
                <td>
                    <%#Eval("Exp")%>
                </td>
                <td>
                    <%#Eval("PeakExp")%>
                </td>
                <td>
                    <%#Eval("Scope")%>
                </td>
                <td>
                    <%#Eval("RaceTimes")%>
                </td>
                <td>
                    <%#Convert.ToInt32(Eval("UpgradeMoney"))%>
                </td>
                <td>
                    <%#Eval("LevelNumber")%>
                </td>
                <td>
                    <asp:LinkButton ID="EditButton" runat="server" CssClass="btnsty" CausesValidation="false"
                        CommandName="Edit" Text="修改" />
                    <asp:LinkButton ID="DeleteButton" runat="server" CssClass="btnsty cred" CausesValidation="false"
                        CommandName="Delete" Text="删除" OnClientClick="return confirm('确定删除？')" />
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>
    </form>
</body>
</html>
